<?php
	session_start();
	require "usercheck.php";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>密码修改</title>
<script type="text/javascript">

function validate_required(field,alerttxt)
{
with (field)
  {
  if (value==null||value=="")
    {alert(alerttxt);return false}
  else {return true}
  }
}
function check(){
	with(document.all){
		if(password.value!=pwdconfirm.value)
		{
			alert("密码不一致")
			input1.value = "";
			input2.value = "";
			return false;
		}
		else return true;
	}

}

function validate_form(thisform)
{
with (thisform)
  {
  	if (validate_required(username,"请输入用户名")==false)
    	{username.focus();return false}
  	if (validate_required(password,"请输入密码")==false)
    	{password.focus();return false}
	if (validate_required(pwdconfirm,"请输入确认密码")==false)
    	{pwdconfirm.focus();return false}
  }
if(check()==false) return false;
else document.forms[0].submit();
}
</script>
</head>

<body>

<p>

<form id="form1" action="changepwddo.php" method="post">
用户名：
  <input type="text" id="username" name="username" size="30" <?php echo "value='".$row['ypmc']."'"; ?> />
</p>
<p>
  新密码：
    <input type="text" id="password" name="password" size="30" <?php echo "value='".$row['ypmc']."'"; ?> />
</p>
<p>确认新密码：
  <input type="text" id="pwdconfirm" name="pwdconfirm" size="30" <?php echo "value='".$row['ypmc']."'"; ?> />
</p>
<input type="button" onClick=<?php if($currenttype=='boss')echo "\"return validate_form(document.forms[0])\"";?> value="提交"> 
</form>
<?php require "back.php";?>
</body>
</html>